home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / muds / pennmush.000 / pennmush-1.50-p8-linux.tar / pennmush / Makefile < prev    next >
Makefile  |  1993-10-22  |  14KB  |  374 lines

  1. # Makefile for PennMUSH 1.50
  2.  
  3. #-----   System configuration    -----#
  4.  
  5. #    SunOS (and possibly Solaris)
  6. # Your system has timelocal(), strdup(), log2(), and getrusage()
  7. #
  8. #SYSDEFS= -DSUN_OS -DHAS_RUSAGE
  9.  
  10. #    HP-UX
  11. # Your system does not have timelocal(), strdup(), etc.  Also,
  12. # despite what the man pages say, it does not have getrusage().
  13. # It is System V-based.
  14. #
  15. #SYSDEFS= -DHPUX -DNEED_STRDUP -Drandom=rand -Dsrandom=srand
  16.  
  17. #    IRIX
  18. # Another System V-derived UNIX. It's got both getrusage() and strdup().
  19. #SYSDEFS= -DHPUX -D_HAS_RUSAGE -Drandom=rand -Dsrandom=srand
  20.  
  21. #    AIX
  22. # Another mutant of System V.
  23. #SYSDEFS= -DHPUX -DHAS_RUSAGE -D_BSD_INCLUDES
  24.  
  25. #    System V, Linux, BSD386
  26. # UNIX flavors designed for Intel, and miscellaneous other System V flavors.
  27. # If it doesn't work, try defining HPUX and/or some of the other defs
  28. # given above.
  29. SYSDEFS= -Di386 -Dsrand=srandom -Drand=random
  30.  
  31. #    Other UNIX flavors
  32. # Ultrix, NeXT (Mach), and assorted others.
  33. #SYSDEFS= -DNEED_STRDUP
  34.  
  35. # You should also take a look at the system options in options.h.
  36.  
  37.  
  38. #-----  Compiler choice, defs, libraries and other fun stuff -----
  39.  
  40. # Whatever you put in for $(CC) should be able to grok at least a
  41. # bit of ANSI C. However, some stuff has been pasted in to try to
  42. # get it to work with compilers that don't.
  43. #
  44. # If you don't plan on doing any debugging, you might want to replace
  45. # the -g with -O for optimization.
  46. # Also, you may want to "strip" the final executable to reduce its size.
  47.  
  48.  
  49. # GCC: if you use this, I _strongly_ recommend a version above 2.0, or
  50. #      a version prior to 1.40. For some reason, this code interacts
  51. #      poorly with some gcc versions.
  52. #      gcc allows the use of the -g and -O flags simultaneously, so
  53. #      you can turn on optimization without losing debugging info.
  54. CC=gcc
  55. # gcc versions before 2.0
  56. #OPTIM= -W -Wreturn-type -Wunused -Wswitch -Wcomment -Wshadow -Wwrite-strings -fpcc-struct-return -g -O
  57. # gcc version 2.0 and higher
  58. OPTIM= -W -Wreturn-type -Wunused -Wswitch -Wcomment -Wshadow -Wwrite-strings -Wformat -Wparentheses -Wuninitialized -O6 -s
  59.  
  60. # Linux: use gcc. In the DEFS section below (near the malloc package, etc.)
  61. #   add  -DNCARGS=0x100000
  62. #   You will also need to remove the #ifndef SUN_OS / #endif  pair from
  63. #   around the strdup() function in stringutil.c
  64. # Bob Green (bob@inmos.co.uk) has managed to build PennMUSH under Linux
  65. #   0.98p4 + gcc 2.2.2d7. I haven't worked with Linux at all. Caveat emptor.
  66.  
  67. # NeXT compiler:
  68. #CC=cc
  69. #OPTIM= -W -Wreturn-type -Wunused -Wswitch -Wcomment -Wshadow -Wwrite-strings -g
  70.  
  71. # HP-UX compiler:
  72. #CC=cc
  73. #OPTIM= -w +Obb800 -Aa -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_HPUX_SOURCE -D_INCLUDE_XOPEN_SOURCE
  74.  
  75. # Generic C compiler. AIX and anything else that you get lucky with.
  76. #CC=cc
  77. #OPTIM= -g
  78.  
  79. # Sun cc (without ANSI libraries)
  80. # Recommendation: go get gcc and use that to compile instead.
  81. # You will need to do the following to convert the code to something
  82. #   that's traditional C (and thus grokkable by Sun cc):
  83. # 1. Replace all occurences of 'void *' in the code with 'char *' 
  84. #    (the traditional C generic pointer type)
  85. # 2. Comment out any "extern" declarations that are causing errors.
  86. # 3. Comment out all MALLOC defs below, and set MALLOC_O=
  87. #    This means you end up using whatever malloc your system provides.
  88. #    Alternatively, you could go through, do the type replacement thing
  89. #    as in step 1. above in smalloc.c, and tinker with it.
  90. # 4. If your pre-processor is fussy, all pre-processor directives must
  91. #    start at the beginning of the line (some of the ones in game.c do
  92. #    not, for example).
  93. #
  94. #CC=cc
  95. #OPTIM=-g -Dconst= -D__TIME__="\"`date +%T`\"" -D__DATE__="\"`date '+%h %d 19%y'`\""
  96.  
  97. # SGI compiler: use gcc instead, if possible.
  98. #CC=cc
  99. #OPTIM= -cckr -g -Dconst= -D__TIME__="\"`date +%T`\"" -D__DATE__="\"`date '+%h %d 19%y'`\""
  100.  
  101. # Other non-ANSI-compliant compilers: Dec C compiler, IBM RT C compiler, etc.
  102. # If it doesn't compile, and the problems look similar to those mentioned
  103. # above for Sun's cc, try making one or more of those changes and recompiling.
  104. # If you need more help, send email to the author.
  105. #CC=cc
  106. #OPTIM=-g -Dconst= -D__TIME__="\"`date +%T`\"" -D__DATE__="\"`date '+%h %d 19%y'`\""
  107.  
  108. # Malloc package options *sigh*
  109. #
  110. # The smalloc.c package is preferred as it doesn't endlessly grow even though
  111. # it has slightly (very slightly) more overhead.
  112. # If you have problems with "illegal pointer combination"s or the like
  113. # when compiling this, it is probably best just to comment out the
  114. # MALLOC and MALLOC_D lines.
  115. MALLOC = smalloc.c
  116. MALLOC_O = smalloc.o
  117. MALLOC_D = -DUSE_SMALLOC -DNCARGS=0x100000
  118.  
  119. # The nalloc package is no longer supported.
  120.  
  121. # The GNU malloc package is nice if it works on your machine. The version
  122. # included here is virtually identical to that included with TinyMUSH 2.0.
  123. # This is a fast, efficient memory allocator.
  124. # This has not really been tested with 1.50. Don't use it unless you're 
  125. # willing to tinker with it.
  126. #MALLOC = gmalloc.c
  127. #MALLOC_O = gmalloc.o
  128. #MALLOC_D =
  129.  
  130. # By default, db.c initially allocates enough space for 10000 objects, then
  131. #   grows the space if needed.  To change this value, include
  132. #   -DDB_INITIAL_SIZE=xxxx where xxxx is the new value (minimum 1).
  133.  
  134. # Choose ONE of the following based on how you want the mud to handle RWHO
  135. #a) Defualt: do not use the RWHO server at all.
  136. DEFS=  $(MALLOC_D)
  137. LIBS=
  138.  
  139. #b) ONLY send info to an RWHO server
  140. #DEFS= -DRWHO_SEND $(MALLOC_D)
  141. #LIBS= -LRWHO -lrwho
  142.  
  143. #c) READ rwho info as well as send it.  This is dangerous UNLESS the RWHO
  144. #   server is on the same machine, or on another locally connected one.  The
  145. #   danger being that it could freeze the mud if the connection timed out.
  146. #DEFS= -DRWHO_SEND -DFULL_RWHO $(MALLOC_D)
  147. #LIBS= -LRWHO -lrwho
  148.  
  149. CFLAGS= $(OPTIM) $(DEFS) $(SYSDEFS)
  150.  
  151. # stupid SYS V shell
  152. SHELL=/bin/sh
  153.  
  154. # for lint target
  155. LINT=lint
  156. LINTFLAGS=-haz $(DEFINES)
  157. LINTFILT=egrep -v '(possible pointer|long assign|not yet im|:$$)'
  158.  
  159. # uncomment the following line if you want to use the concentrator
  160. #CONC = concentrate
  161.  
  162. # default: this is the output of make all if no RWHO server is used
  163. #OLD_OUTFILES = netmud mkindx dump extract $(CONC)
  164. OUTFILES = netmud mkindx $(CONC)
  165.  
  166. # Use this OUTFILES if you WANT the RWHO stuff
  167. #OLD_OUTFILES = rwho_made netmud mkindx dump extract $(CONC)
  168. #OUTFILES = rwho_made netmud mkindx $(CONC)
  169.  
  170. ###############################################################################
  171. #         You shouldn't have to change anything below this line.              #
  172. ###############################################################################
  173. SHARED_FILES  = db.c compress.c player_list.c stringutil.c attrib.c mem_check.c
  174. SHARED_OFILES = db.o compress.o player_list.o stringutil.o attrib.o mem_check.o
  175.  
  176. DB_FILES  = destroy.c $(SHARED_FILES)
  177. DB_OFILES = destroy.o $(SHARED_OFILES)
  178.  
  179. DUMP_FILES  = dump.c unparse.c $(SHARED_FILES)
  180. DUMP_OFILES = dump.o unparse.o $(SHARED_OFILES)
  181.  
  182. # Everything except interface.c --- allows for multiple interfaces
  183. C_FILES= create.c game.c look.c match.c move.c player.c predicates.c \
  184.      rob.c set.c speech.c utils.c wiz.c timer.c boolexp.c unparse.c \
  185.      cque.c eval.c wild.c interface.c log.c conf.c mail.c rpage.c chat.c \
  186.      convdb.c atr_tab.c flags.c $(DB_FILES)
  187.  
  188. # .o versions of above
  189. O_FILES= create.o game.o look.o match.o move.o player.o predicates.o \
  190.      rob.o set.o speech.o utils.o wiz.o timer.o boolexp.o unparse.o \
  191.      cque.o eval.o wild.o interface.o log.o conf.o mail.o rpage.o chat.o \
  192.      atr_tab.o flags.o $(DB_OFILES)
  193.  
  194. H_FILES = attrib.h config.h copyright.h db.h flags.h externs.h globals.h \
  195.       help.h interface.h match.h mem_check.h oldattrib.h options.h.dist \
  196.       game.h atr_tab.h dbdefs.h ansi.h chat.h version.h getpagesize.h \
  197.           bigrams.h.dist
  198.  
  199. EXTRA_CFILES= bsd.c connect.c dump.c extract.c mkindx.c smalloc.c announce.c \
  200.          bigrams.c gmalloc.c
  201.  
  202. AUX_FILES = CHANGES-1 CHANGES-2 CHANGES-3 CHANGES-4 CHANGES-5 CHANGES-6 \
  203.         Makefile.dist README BIGRAMS
  204.  
  205. RWHO_FILES = RWHO/HOW_TO RWHO/README RWHO/Makefile RWHO/clilib.c RWHO/mudwho.c
  206.  
  207. GAME_FILES = game/mush.conf game/sites.conf game/lockout.conf game/names.conf \
  208.          game/restart game/maildb.Z \
  209.          game/data/minimal.db.Z game/txt game/log game/save 
  210.  
  211. # Files in the standard distribution
  212. DISTFILES= $(C_FILES) $(H_FILES) $(EXTRA_CFILES) \
  213.         $(AUX_FILES) $(RWHO_FILES) $(GAME_FILES)
  214.  
  215. # Files in a quickie distribution
  216. QUICKFILES = $(C_FILES) $(H_FILES) $(EXTRA_CFILES) \
  217.          $(AUX_FILES) $(RWHO_FILES) game/txt/help.txt
  218.  
  219. all: $(OUTFILES)
  220.  
  221. install_conc: $(CONC)
  222.     -rm -f game/concentrate
  223.     (cd game; ln -s ../concentrate concentrate)
  224.  
  225. install: $(OUTFILES)
  226.     -rm -f game/netmush
  227.     -rm -f game/mkindx
  228.     (cd game; \
  229.     ln -s ../netmud netmush; \
  230.     ln -s ../mkindx mkindx)
  231.  
  232. concentrate: conc.c
  233.     $(CC) $(CFLAGS) -o concentrate conc.c
  234.  
  235. announce: announce.c
  236.     $(CC) $(CFLAGS) -o announce announce.c
  237.  
  238. bigrams: bigrams.c
  239.     $(CC) $(CFLAGS) -o bigrams bigrams.c
  240.  
  241. rwho_made:
  242.     (cd RWHO; make CC="$(CC)" CFLAGS="$(CFLAGS)")
  243.     touch rwho_made
  244.  
  245. TAGS: *.c *.h
  246.     etags *.c *.h
  247.  
  248. mkindx: mkindx.c
  249.     $(CC) -o mkindx mkindx.c
  250.                         
  251. netmud: $(O_FILES) $(MALLOC_O)
  252.     -mv -f netmud netmud~
  253.     $(CC) $(CFLAGS) -o netmud $(O_FILES) $(MALLOC_O) $(LIBS) -lm
  254.  
  255. saber:  $(O_FILES) $(MALLOC_O)
  256.     #load $(CFLAGS) -o netmud $(C_FILES) $(MALLOC_O) $(LIBS)
  257.  
  258. lint: $(DISTFILES)
  259.     $(LINT) $(LINTFLAGS) $(C_FILES) $(LLIBS) 2>&1 | $(LINTFILT)
  260. lint-p: $(DISTFILES)
  261.     $(LINT) $(LINTFLAGS) -p $(C_FILES) $(LLIBS) 2>&1 | $(LINTFILT)
  262.  
  263. tags: $(DISTFILES)
  264.     etags *.c *.h
  265.  
  266. dump: $(DUMP_OFILES) $(MALLOC_O)
  267.     -rm -f dump
  268.     $(CC) $(CFLAGS) -o dump $(DUMP_OFILES) $(MALLOC_O) $(LIBS)
  269.  
  270. extract: extract.o utils.o $(SHARED_OFILES) $(MALLOC_O)
  271.     -rm -f extract
  272.     $(CC) $(CFLAGS) -o extract extract.o utils.o $(SHARED_OFILES) \
  273.           $(MALLOC_O) $(LIBS)
  274.  
  275. decompress: decompress.o compress.o
  276.     -rm -f decompress
  277.     $(CC) $(CFLAGS) -o decompress decompress.o compress.o $(LIBS)
  278.  
  279. depend:
  280.     makedepend -- $(CFLAGS) -- $(C_FILES)
  281.  
  282. clean:
  283.     -rm -f *.o *~ *.orig *.rej
  284.     -rm -f a.out core gmon.out $(OUTFILES) 
  285.     (cd game; rm -f *.log netmush mkindx)
  286.     (cd RWHO; make clean)
  287.  
  288. zap:
  289.     (cd /tmp/$$USER; rm -f *.o *~)
  290.  
  291. #dist.tar.Z: $(DISTFILES)
  292. dist.tar.Z:
  293.     tar -cvf /tmp/dist.tar $(AUX_FILES) $(RWHO_FILES) $(GAME_FILES)
  294.     (cd src; tar -uvf /tmp/dist.tar $(C_FILES) $(EXTRA_CFILES))
  295.     (cd hdrs; tar -uvf /tmp/dist.tar $(H_FILES))
  296.     (compress /tmp/dist.tar)
  297.  
  298. #qd.tar.Z: $(QUICKFILES)
  299. qd.tar.Z:
  300.     tar -cvf /tmp/$$USER/qd.tar $(RWHO_FILES)
  301.     (cd src; tar -uvf /tmp/$$USER/qd.tar $(C_FILES) $(EXTRA_CFILES))
  302.     (cd hdrs; tar -uvf /tmp/$$USER/qd.tar $(H_FILES))
  303.  
  304. # DO NOT DELETE THIS LINE -- make depend depends on it.
  305.  
  306. atr_tab.o: atr_tab.h attrib.h
  307. attrib.o: config.h copyright.h version.h db.h flags.h attrib.h externs.h
  308. attrib.o: oldattrib.h interface.h options.h dbdefs.h
  309. boolexp.o: copyright.h db.h flags.h attrib.h config.h version.h match.h
  310. boolexp.o: interface.h externs.h options.h dbdefs.h
  311. bsd.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h
  312. bsd.o: globals.h help.h externs.h options.h dbdefs.h
  313. chat.o: config.h copyright.h version.h options.h
  314. compress.o: copyright.h config.h version.h db.h flags.h attrib.h bigrams.h
  315. compress.o: options.h dbdefs.h
  316. conf.o: config.h copyright.h version.h interface.h db.h flags.h attrib.h
  317. conf.o: options.h dbdefs.h
  318. cque.o: config.h copyright.h version.h db.h flags.h attrib.h interface.h
  319. cque.o: externs.h match.h options.h dbdefs.h
  320. create.o: config.h copyright.h version.h db.h flags.h attrib.h interface.h
  321. create.o: externs.h options.h dbdefs.h
  322. db.o: copyright.h config.h version.h interface.h db.h flags.h attrib.h
  323. db.o: externs.h options.h dbdefs.h
  324. destroy.o: copyright.h config.h version.h db.h flags.h attrib.h externs.h
  325. destroy.o: globals.h options.h dbdefs.h
  326. dump.o: copyright.h config.h version.h db.h flags.h attrib.h options.h dbdefs.h
  327. eval.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h
  328. eval.o: globals.h externs.h options.h dbdefs.h
  329. extract.o: copyright.h config.h version.h db.h flags.h attrib.h options.h
  330. extract.o: dbdefs.h
  331. flags.o: copyright.h attrib.h flags.h config.h dbdefs.h db.h externs.h
  332. flags.o: options.h version.h interface.h
  333. game.o: config.h copyright.h version.h db.h flags.h attrib.h game.h externs.h
  334. game.o: interface.h match.h globals.h options.h dbdefs.h
  335. gmalloc.o: getpagesize.h 
  336. interface.o: config.h copyright.h version.h bsd.c db.h flags.h attrib.h
  337. interface.o: externs.h globals.h interface.h options.h dbdefs.h
  338. log.o: config.h copyright.h version.h externs.h db.h flags.h attrib.h
  339. log.o: interface.h options.h dbdefs.h
  340. look.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h 
  341. look.o: externs.h ansi.h match.h options.h dbdefs.h
  342. mail.o: config.h copyright.h version.h db.h flags.h attrib.h interface.h
  343. mail.o: options.h dbdefs.h
  344. match.o: copyright.h config.h version.h db.h flags.h attrib.h externs.h
  345. match.o: match.h globals.h options.h dbdefs.h
  346. mem_check.o: config.h copyright.h version.h options.h
  347. mkindx.o: help.h
  348. move.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h
  349. move.o: externs.h globals.h match.h options.h dbdefs.h
  350. player.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h
  351. player.o: externs.h options.h dbdefs.h
  352. player_list.o: copyright.h config.h version.h db.h flags.h attrib.h
  353. player_list.o: globals.h externs.h interface.h options.h dbdefs.h
  354. predicates.o: copyright.h config.h version.h externs.h db.h flags.h attrib.h 
  355. predicates.o: interface.h globals.h ansi.h options.h dbdefs.h
  356. rob.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h
  357. rob.o: externs.h match.h options.h
  358. set.o: copyright.h config.h version.h db.h flags.h attrib.h match.h dbdefs.h
  359. set.o: externs.h interface.h options.h
  360. speech.o: copyright.h config.h version.h externs.h db.h flags.h attrib.h
  361. speech.o: interface.h match.h options.h dbdefs.h
  362. stringutil.o: copyright.h config.h version.h interface.h db.h flags.h attrib.h
  363. stringutil.o: globals.h options.h dbdefs.h
  364. timer.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h
  365. timer.o: externs.h match.h options.h dbdefs.h
  366. unparse.o: config.h copyright.h version.h db.h flags.h attrib.h externs.h
  367. unparse.o: interface.h options.h dbdefs.h
  368. utils.o: copyright.h config.h version.h interface.h db.h flags.h attrib.h
  369. utils.o: options.h dbdefs.h
  370. wild.o: config.h copyright.h version.h interface.h db.h flags.h attrib.h
  371. wild.o: globals.h options.h dbdefs.h
  372. wiz.o: copyright.h config.h version.h db.h flags.h attrib.h interface.h match.h
  373. wiz.o: externs.h options.h dbdefs.h
  374.